package com.button.admin;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;

@EnableAutoConfiguration
@SpringBootApplication
public class SpringBootAdminClient {
    public static void main(String[] args) {
        SpringApplication.run(SpringBootAdminClient.class, args);
    }
    
    /**
     * 
     * 类名称  : SecurityPassAllConfig <br/>
     * 功能描述: spring-boot-starter-security引入这个包，默认会把所有的请求都给拦截下来，需要进行验证，这里我们将所有请求都放行了
     */
    @Configuration
    public static class SecurityPassAllConfig extends WebSecurityConfigurerAdapter {
       @Override
       protected void configure(HttpSecurity http) throws Exception{
           http.authorizeRequests().anyRequest().permitAll().and().csrf().disable();
       }
    } 
}
